/**
 * VecBall.h
 * Coyright (c) 2009 Xiaofeng Gu. All Rights Reserved.
 * Author : Xiaofeng Gu
 *
 * Creation Data : 2009/08/02
 */

#pragma once

#include "Vec.h"
#include "IGraphics.h"

class CTransNode;

class CVecBall : public IRender
{
public:
	CVecBall();
	virtual~ CVecBall();

	void			Init(CTransNode* pNode);
	void			Init(const CVec& center, const CVec& vec);

	void			ReBuildForFi(double fiValue);
	void			ReBuildForSita(double sitaValue);

	virtual void	Render();

	double			GetFiAngle() { return m_dfiAngle; }
	double			GetSitaAngle() { return m_sitaAngle; }

	CVec			GetBallVec() { return m_ballVec; }

protected:
	void			Draw();
	void			DrawHCir();
	void			DrawVCir();
	void			DrawHVec();
	void			DrawHArc();
	void			DrawVec();
	void			DrawVArc();

private:
	double			m_dBallRadius;
	double			m_dfiAngle;
	double			m_sitaAngle;
	CVec			m_ballCenter;
	CVec			m_ballVec;
	CVec			m_horizontalVec;
	double			m_horizontalRadius;

private:
	long			m_lSegmentCount;
};